package com.weiyin.examination.module;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @author njf
 * @date 2017/9/18
 */

public class TestModule implements Parcelable {
    /**
     * 题目id
     */
    private String id;
    /**
     * 题目类型
     */
    private String type;
    /**
     * 题目标题
     */
    private String subjectTitle;
    /**
     * 题目分数
     */
    private String score;
    /**
     * 题目图片url
     */
    private String subjectUrl;
    /**
     * mp3
     */
    private List<Mp3Module> mp3UrlList;
    /**
     * 备选答案
     */
    private List<SelectionModule> selectionList;
    /**
     * 正确答案
     */
    private List<AnswerModule> rightAnswerList;
    /**
     * pdf信息
     */
    private PdfModule[] answerPdf;
    /**
     * 五线谱第一行Y坐标
     */
    private String pdfY;
    /**
     * 默认置灰（ID 区分，逗号隔开）
     */
    private String defaultGrey;
    /**
     * 输入答案图片地址（ 按行数逗号隔开）
     */
    private String rightAnswerUrl;
    /**
     * 题目每一空Y坐标
     */
    private List<SubjectY> subjectYList;
    /**
     * 小节坐标
     */
    private List<RestrictModule> restrictList;

    /**
     * 准考证号
     */
    private String tickNumber;
    /**
     * 是否临时调号
     */
    private String bTemporaryKey;

    protected TestModule(Parcel in) {
        id = in.readString();
        type = in.readString();
        subjectTitle = in.readString();
        score = in.readString();
        subjectUrl = in.readString();
        mp3UrlList = in.createTypedArrayList(Mp3Module.CREATOR);
        selectionList = in.createTypedArrayList(SelectionModule.CREATOR);
        rightAnswerList = in.createTypedArrayList(AnswerModule.CREATOR);
        answerPdf = in.createTypedArray(PdfModule.CREATOR);
        pdfY = in.readString();
        defaultGrey = in.readString();
        rightAnswerUrl = in.readString();
        subjectYList = in.createTypedArrayList(SubjectY.CREATOR);
        restrictList = in.createTypedArrayList(RestrictModule.CREATOR);
        tickNumber = in.readString();
        bTemporaryKey = in.readString();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(id);
        dest.writeString(type);
        dest.writeString(subjectTitle);
        dest.writeString(score);
        dest.writeString(subjectUrl);
        dest.writeTypedList(mp3UrlList);
        dest.writeTypedList(selectionList);
        dest.writeTypedList(rightAnswerList);
        dest.writeTypedArray(answerPdf, flags);
        dest.writeString(pdfY);
        dest.writeString(defaultGrey);
        dest.writeString(rightAnswerUrl);
        dest.writeTypedList(subjectYList);
        dest.writeTypedList(restrictList);
        dest.writeString(tickNumber);
        dest.writeString(bTemporaryKey);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<TestModule> CREATOR = new Creator<TestModule>() {
        @Override
        public TestModule createFromParcel(Parcel in) {
            return new TestModule(in);
        }

        @Override
        public TestModule[] newArray(int size) {
            return new TestModule[size];
        }
    };

    public String getbTemporaryKey() {
        return bTemporaryKey;
    }

    public void setbTemporaryKey(String bTemporaryKey) {
        this.bTemporaryKey = bTemporaryKey;
    }

    public void setTickNumber(String tickNumber) {
        this.tickNumber = tickNumber;
    }

    public String getTickNumber() {
        return tickNumber;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSubjectTitle() {
        return subjectTitle;
    }

    public void setSubjectTitle(String subjectTitle) {
        this.subjectTitle = subjectTitle;
    }

    public String getScore() {
        return score;
    }

    public void setScore(String score) {
        this.score = score;
    }

    public String getSubjectUrl() {
        return subjectUrl;
    }

    public void setSubjectUrl(String subjectUrl) {
        this.subjectUrl = subjectUrl;
    }

    public List<Mp3Module> getMp3UrlList() {
        return mp3UrlList;
    }

    public void setMp3UrlList(List<Mp3Module> mp3UrlList) {
        this.mp3UrlList = mp3UrlList;
    }

    public List<SelectionModule> getSelectionList() {
        return selectionList;
    }

    public void setSelectionList(List<SelectionModule> selectionList) {
        this.selectionList = selectionList;
    }

    public List<AnswerModule> getRightAnswerList() {
        return rightAnswerList;
    }

    public void setRightAnswerList(List<AnswerModule> rightAnswerList) {
        this.rightAnswerList = rightAnswerList;
    }

    public PdfModule[] getAnswerPdf() {
        return answerPdf;
    }

    public void setAnswerPdf(PdfModule[] answerPdf) {
        this.answerPdf = answerPdf;
    }

    public String getPdfY() {
        return pdfY;
    }

    public void setPdfY(String pdfY) {
        this.pdfY = pdfY;
    }

    public String getDefaultGrey() {
        return defaultGrey;
    }

    public void setDefaultGrey(String defaultGrey) {
        this.defaultGrey = defaultGrey;
    }

    public String getRightAnswerUrl() {
        return rightAnswerUrl;
    }

    public void setRightAnswerUrl(String rightAnswerUrl) {
        this.rightAnswerUrl = rightAnswerUrl;
    }

    public List<SubjectY> getSubjectYList() {
        return subjectYList;
    }

    public void setSubjectYList(List<SubjectY> subjectYList) {
        this.subjectYList = subjectYList;
    }

    public List<RestrictModule> getRestrictList() {
        return restrictList;
    }

    public void setRestrictList(List<RestrictModule> restrictList) {
        this.restrictList = restrictList;
    }
}
